package org.projsquirrel;

import android.content.Context;
import android.content.res.TypedArray;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Gallery;
import android.widget.GridView;
import android.widget.ImageView;

public class ImageAdapter extends BaseAdapter{
	int GalItemBg;
	private Context mContext;

    public ImageAdapter(Context c) {
        mContext = c;
        //TypedArray typArray = obtainStyledAttributes(R.styleable.GalleryTheme);
        //GalItemBg = typArray.getResourceId(R.styleable.GalleryTheme_android_galleryItemBackground, 0);
        //typArray.recycle();

    }

    public int getCount() {
        return mThumbIds.length;
    }

    public Object getItem(int position) {
        return null;
    }

    public long getItemId(int position) {
        return 0;
    }

    // create a new ImageView for each item referenced by the Adapter
    public View getView(int position, View convertView, ViewGroup parent) {
        ImageView imageView = new ImageView(mContext);
        imageView.setImageResource(mThumbIds[position]);
        imageView.setLayoutParams(new Gallery.LayoutParams(90, 90));
        imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
        imageView.setScaleType(ImageView.ScaleType.FIT_XY);
        return imageView;
    }

    // references to our images
    private Integer[] mThumbIds = {
			R.drawable.pic1, R.drawable.pic2, R.drawable.pic3, R.drawable.pic4, R.drawable.pic5, 
			R.drawable.pic6, R.drawable.pic7,R.drawable.pic8
	    };

}
